var $meetings = $('#meetings');
$meetings.html('<%= j(render partial: "decidim/meetings/shared/meetings", locals: { component: }).strip.html_safe %>');

var $urlCalendarUrl = $('#urlCalendarUrl');
$urlCalendarUrl.val("<%= short_url(route_name: "calendar", params: { filter: params.fetch(:filter, {}).try(:to_unsafe_hash) }) %>");

var $map = $("#map");
var controller = $map.data("map-controller");
if (controller) {
  var markerData = JSON.parse('<%= escape_javascript cell("decidim/map", search.result, metadata_card: "decidim/meetings/meeting_card_metadata").geocoded_data.to_json.html_safe %>');
  controller.clearMarkers();

  if (markerData.length > 0) {
    controller.addMarkers(markerData);
  }
}
